package WTE;

import java.util.Scanner;

public class Demo_05 {
    public static void main(String[] args) {
        method1();

    }

    /**
     * 统计回文
     */
    public static void method1() {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String A = in.nextLine();
        String B = in.nextLine();

        String prev = "";
        int sum = 0;
        String cur;

        for (int i = 0; i < A.length() + 1; i++) {

            if (i == A.length()) {
                cur = prev + B;
            } else {
                cur = prev + B + A.substring(i);
            }

            int left = 0;
            int right = cur.length() - 1;
            sum+=compare(cur,left,right);

            if(i == A.length()){
                break;
            }
            prev = prev + A.charAt(i);
        }

        System.out.println(sum);
    }
    public static int compare(String cur,int left,int right){
        while(left <= right){
            if(cur.charAt(left) == cur.charAt(right)){
                left++;
                right--;
            }else{
                return 0;
            }
        }
        return 1;
    }

    /**
     * 连续最大和
     */
    public static void method2(){

    }

}
